import request from "@/utils/request";

const BASE_URL = "/api/v1";
const CommonAPI = {
  /**
   * 获取全部的分类（是否包含叶子结点）
   * @param params
   */
  getAllMaterialCategory(params: AllMaterialCategoryForm) {
    return request({
      url: `${BASE_URL}/common/allMaterialCategory`,
      method: "get",
      params,
    });
  },

  getCategoryList(params: any) {
    return request({
      url: `${BASE_URL}/requirementCategory/list`,
      method: "get",
      params,
    });
  },
};

export interface AllMaterialCategoryForm {
  isLeaf: boolean;
}

export default CommonAPI;
